package com.lineage.data.item_armor.set;

import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.serverpackets.ServerBasePacket;

public class Effect_Hit_modifier implements ArmorSetEffect {
  private final int _add;
  
  public Effect_Hit_modifier(int add) {
    this._add = add;
  }
  
  public void giveEffect(L1PcInstance pc) {
    pc.addHitModifierByArmor(this._add);
    if (pc.getarmor_setgive())
      pc.sendPackets((ServerBasePacket)new S_SystemMessage("套装效果[近距离命中]:+" + this._add)); 
  }
  
  public void cancelEffect(L1PcInstance pc) {
    pc.addHitModifierByArmor(-this._add);
    if (!pc.getarmor_setgive())
      pc.sendPackets((ServerBasePacket)new S_SystemMessage("移除套装效果[近距离命中]:-" + this._add)); 
  }
  
  public int get_mode() {
    return this._add;
  }
}
